subfarc$treated <- as.factor(subfarc$treatment)
subfarc <- na.omit(subfarc)
fitM <- lm(ideology_personal ~ treated, data = subfarc)
fitY <- lm(moderation_score ~ treated + ideology_personal, data = subfarc)
fitMed <- mediation::mediate(fitM, fitY, treat="treated", mediator="ideology_personal",boot = TRUE, sims = 500)
ggsave("f4.png",plot = f4, dpi = 300)
ggsave("f4.tiff",plot = f4, dpi = 300)
c <- imputedC %>% group_by(conflict_score) %>% summarize(mean_trust_byestudio = mean(trust_score, na.rm = T))
c <- merge(c, imputedC %>% count(conflict_score), by = "conflict_score")
colnames(c)[3] <- "N"
c <- merge(c,imputedC %>% group_by(conflict_score) %>% summarize(mean_democracy_byestudio = mean(democracy_score, na.rm = T)))
c <- merge(c,imputedC %>% group_by(conflict_score) %>% summarize(mean_moderation_byestudio = mean(moderation_score, na.rm = T)))
t <- imputedT %>% group_by(conflict_score) %>% summarize(mean_trust_byestudio = mean(trust_score, na.rm = T))
t <- merge(t, imputedT %>% count(conflict_score), by = "conflict_score")
colnames(t)[3] <- "N"
t <- merge(t,imputedT %>% group_by(conflict_score) %>% summarize(mean_democracy_byestudio = mean(democracy_score, na.rm = T)))
t <- merge(t,imputedT %>% group_by(conflict_score) %>% summarize(mean_moderation_byestudio = mean(moderation_score, na.rm = T)))
f5a <- ggplot(data=c,
aes(x=conflict_score, y=mean_moderation_byestudio)) +
geom_point(aes(size = N), colour = "red")+
geom_smooth(aes(weight = N), method='lm', se = F, size = 0.5, color = "black", na.rm = T) +
labs(#title = "Ex-combatant conflict experience and moderation score",
subtitle = "Control group (N = 117)",
x = "Conflict experience score",
y = "Moderation score")+
scale_y_continuous(limits = c(-2, 1))+
scale_x_continuous(limits = c(-2, 1))+
theme(axis.line = element_line(colour = "black")) +
theme(text = element_text(size = 8))+
theme(panel.background = element_blank())+
theme(legend.position="none")
f5b <- ggplot(data=t,
aes(x=conflict_score, y=mean_moderation_byestudio)) +
geom_point(aes(size = N), colour = "blue")+
geom_smooth(aes(weight = N), method='lm', se = F, size = 0.5, color = "black", na.rm = T) +
labs(#title = "Ex-combatant conflict experience and moderation score",
subtitle = "Treatment group (N = 158)",
x = "Conflict experience score",
y = "Moderation score")+
scale_y_continuous(limits = c(-2, 1))+
scale_x_continuous(limits = c(-2, 1))+
theme(axis.line = element_line(colour = "black")) +
theme(text = element_text(size = 8))+
theme(panel.background = element_blank())+
theme(legend.position="none")
f5 <- ggarrange(f5a,f5b, legend = "none")
ggsave("f5.tiff",plot = f3, dpi = 300, width = 4, height = 1.75, unit = "in")
ggsave("f5.png",plot = f3, width = 4, height = 1.75, unit = "in")
#### Figure A 1: Balance across demographic characteristics ####
library(ggplot2)
library(plyr)
age <- ggplot(farc, aes(x=age, fill = treated, color=treated)) +
geom_histogram(position="identity", alpha = 0.5) +
labs(title = " ",
x = "Age",
y = "Frequency")+
theme(panel.background = element_blank())+
theme_bw()
ggsave("balance_age.png",plot = age)
race <- ggplot(farc, aes(x=race, fill = treated, color=treated)) +
geom_histogram(position="identity", alpha = 0.5) +
labs(title = " ",
x = "Race",
y = "Frequency")+
theme(panel.background = element_blank())+
theme_bw()
ggsave("balance_race.png",plot = race)
schooling <- ggplot(farc, aes(x=schooling, fill = treated, color=treated)) +
geom_histogram(position="identity", alpha = 0.5) +
labs(title = " ",
x = "Education",
y = "Frequency")+
theme(panel.background = element_blank())+
theme_bw()
ggsave("balance_schooling.png",plot = schooling)
pdr <- ggplot(farc, aes(x=pdr, fill = treated, color=treated)) +
geom_histogram(position="identity", alpha = 0.5)+
labs(title = " ",
x = "Currently reincorporation process (PDR)",
y = "Frequency")+
theme(panel.background = element_blank())+
theme_bw()
ggsave("balance_pdr.png",plot = pdr)
voted <- ggplot(farc, aes(x=voted2016, fill = treated, color=treated)) +
geom_histogram(position="identity", alpha = 0.5)+
labs(title = " ",
x = "Voted in 2016",
y = "Frequency")+
theme(panel.background = element_blank())+
theme_bw()
ggsave("balance_voted.png",plot = voted)
age <- ggplot(farc, aes(x=age, fill = treated, color=treated)) +
geom_histogram(position="identity", alpha = 0.5) +
labs(title = " ",
x = "Age",
y = "Frequency")+
theme(panel.background = element_blank())+
theme_bw()
ggsave("fA1_balance_age.png",plot = age)
race <- ggplot(farc, aes(x=race, fill = treated, color=treated)) +
geom_histogram(position="identity", alpha = 0.5) +
labs(title = " ",
x = "Race",
y = "Frequency")+
theme(panel.background = element_blank())+
theme_bw()
ggsave("fA1_balance_race.png",plot = race)
schooling <- ggplot(farc, aes(x=schooling, fill = treated, color=treated)) +
geom_histogram(position="identity", alpha = 0.5) +
labs(title = " ",
x = "Education",
y = "Frequency")+
theme(panel.background = element_blank())+
theme_bw()
ggsave("fA1_balance_schooling.png",plot = schooling)
pdr <- ggplot(farc, aes(x=pdr, fill = treated, color=treated)) +
geom_histogram(position="identity", alpha = 0.5)+
labs(title = " ",
x = "Currently reincorporation process (PDR)",
y = "Frequency")+
theme(panel.background = element_blank())+
theme_bw()
ggsave("fA1_balance_pdr.png",plot = pdr)
voted <- ggplot(farc, aes(x=voted2016, fill = treated, color=treated)) +
geom_histogram(position="identity", alpha = 0.5)+
labs(title = " ",
x = "Voted in 2016",
y = "Frequency")+
theme(panel.background = element_blank())+
theme_bw()
ggsave("fA1_balance_voted.png",plot = voted)
ggsave("f5.tiff",plot = f5, dpi = 300, width = 4, height = 1.75, unit = "in")
ggsave("f5.png",plot = f5, width = 4, height = 1.75, unit = "in")
entry_year <-  ggplot(farc, aes(x=entry_year, fill = treated, color=treated)) +
geom_histogram(position="identity", alpha = 0.5)+
labs(title = " ",
x = "Year of entry into FARC (guerrilla)",
y = "Frequency")+
theme(panel.background = element_blank())+
theme_bw()
ggsave("fA2_balance_yearentry.png",plot = entry_year)
entry_age <- ggplot(farc, aes(x=entry_age, fill = treated, color=treated)) +
geom_histogram(position="identity", alpha = 0.5) +
labs(title = " ",
x = "Age of entry into FARC (guerrilla)",
y = "Frequency")+
theme(panel.background = element_blank())+
theme_bw()
ggsave("fA2_balance_ageentry.png",plot = entry_age)
yearsin_farc <- ggplot(farc, aes(x=yearsin_farc, fill = treated, color=treated)) +
geom_histogram(position="identity", alpha = 0.5)+
labs(title = " ",
x = "Years spent with FARC (guerrilla)",
y = "Frequency")+
theme(panel.background = element_blank())+
theme_bw()
ggsave("fA2_balance_timespent.png",plot = yearsin_farc)
ideological_education <- ggplot(farc, aes(x=ideological_education, fill = treated, color=treated)) +
geom_histogram(position="identity", alpha = 0.5)+
labs(title = " ",
x = "During conflict, received ideological training",
y = "Frequency")+
theme(panel.background = element_blank())+
theme_bw()
ggsave("fA2_balance_ideological_education.png",plot =ideological_education)
commander_interest <- ggplot(farc, aes(x=commander_interest, fill = treated, color=treated)) +
geom_histogram(position="identity", alpha = 0.5)+
labs(title = " ",
x = "During conflict, commander cared about what respondent had to say",
y = "Frequency")+
theme(panel.background = element_blank())+
theme_bw()
ggsave("fA2_balance_commander_interest.png",plot =commander_interest)
debate <- ggplot(farc, aes(x=debate, fill = treated, color=treated)) +
geom_histogram(position="identity", alpha = 0.5)+
labs(title = " ",
x = "During conflict, debated politics with unit",
y = "Frequency")+
theme(panel.background = element_blank())+
theme_bw()
ggsave("fA2_balance_debate.png",plot =debate)
shot <- ggplot(farc, aes(x=shot, fill = treated, color=treated)) +
geom_histogram(position="identity", alpha = 0.5)+
labs(title = " ",
x = "During conflict, was shot at",
y = "Frequency")+
theme(panel.background = element_blank())+
theme_bw()
ggsave("fA2_balance_shot.png",plot =shot)
lifethreat <- ggplot(farc, aes(x=lifethreat, fill = treated, color=treated)) +
geom_histogram(position="identity", alpha = 0.5)+
labs(title = " ",
x = "During conflict, life was threatened",
y = "Frequency")+
theme(panel.background = element_blank())+
theme_bw()
ggsave("fA2_balance_lifethreat.png", plot =lifethreat)
farcT <- subset(farc, treatment=="1")
farcC <- subset(farc, treatment=="0")
#trust in government
c1T <- mean(farcT$trust_gov, na.rm = T)
c1C <- mean(farcC$trust_gov, na.rm = T)
se1T <- std.error(farcT$trust_gov, na.rm = T)
se1C <- std.error(farcC$trust_gov, na.rm = T)
#trust in mayors office
c2T <- mean(farcT$trust_mayors, na.rm = T)
c2C <- mean(farcC$trust_mayors, na.rm = T)
se2T <- std.error(farcT$trust_mayors, na.rm = T)
se2C <- std.error(farcC$trust_mayors, na.rm = T)
#trust in municipal council
c3T <- mean(farcT$trust_council, na.rm = T)
c3C <- mean(farcC$trust_council, na.rm = T)
se3T <- std.error(farcT$trust_council, na.rm = T)
se3C <- std.error(farcC$trust_council, na.rm = T)
#trust in justice system
c4T <- mean(farcT$trust_justice, na.rm = T)
c4C <- mean(farcC$trust_justice, na.rm = T)
se4T <- std.error(farcT$trust_justice, na.rm = T)
se4C <- std.error(farcC$trust_justice, na.rm = T)
#trust in JEP
c5T <- mean(farcT$trust_jep, na.rm = T)
c5C <- mean(farcC$trust_jep, na.rm = T)
se5T <- std.error(farcT$trust_jep, na.rm = T)
se5C <- std.error(farcC$trust_jep, na.rm = T)
means <- c(c1C, c1T, c2C, c2T, c3C, c3T, c4C, c4T, c5C, c5T)
se <- c(se1C, se1T, se2C, se2T, se3C, se3T, se4C, se4T, se5C, se5T)
dataplot <- data.frame(x = c('Government', 'Government', 'Mayor', 'Mayor', 'Consejo', 'Consejo', 'Justice', 'Justice', 'Justice Peace', 'Justice Peace'),
means, se,
Treatment = c('Control', 'Treatment', 'Control', 'Treatment', 'Control', 'Treatment', 'Control', 'Treatment', 'Control', 'Treatment'))
institutions <- ggplot(dataplot, aes(x=x, y=means, fill=Treatment)) +
geom_bar(stat="identity",
position=position_dodge()) +
geom_errorbar(aes(ymin=means-se, ymax=means+se), width=.2,
position=position_dodge(.9)) +
theme(text = element_text(size = 15)) +
scale_x_discrete(name ="Trust in institutions")+
scale_y_continuous(name = "Mean agreement", limits = c(0, 10))+
theme(panel.background = element_blank())+
theme_bw()
ggsave("diffmeans_institutions.png",plot = institutions)
ggsave("fA5_a.png",plot = institutions)
d1T <- mean(farcT$system_inclusive, na.rm = T)
d1C <- mean(farcC$system_inclusive, na.rm = T)
dse1T <- std.error(farcT$system_inclusive, na.rm = T)
dse1C <- std.error(farcC$system_inclusive, na.rm = T)
d2T <- mean(farcT$democracy_best, na.rm = T)
d2C <- mean(farcC$democracy_best, na.rm = T)
dse2T <- std.error(farcT$democracy_best, na.rm = T)
dse2C <- std.error(farcC$democracy_best, na.rm = T)
d3T <- mean(farcT$farc_goals, na.rm = T)
d3C <- mean(farcC$farc_goals, na.rm = T)
dse3T <- std.error(farcT$farc_goals, na.rm = T)
dse3C <- std.error(farcC$farc_goals, na.rm = T)
d4T <- mean(farcT$voice_ingov, na.rm = T)
d4C <- mean(farcC$voice_ingov, na.rm = T)
dse4T <- std.error(farcT$voice_ingov, na.rm = T)
dse4C <- std.error(farcC$voice_ingov, na.rm = T)
d5T <- mean(farcT$mecdem_efficient, na.rm = T)
d5C <- mean(farcC$mecdem_efficient, na.rm = T)
dse5T <- std.error(farcT$mecdem_efficient, na.rm = T)
dse5C <- std.error(farcC$mecdem_efficient, na.rm = T)
means3 <- c(d1C, d1T, d2C, d2T, d3C, d3T, d4C, d4T, d5C, d5T)
se3 <- c(dse1C, dse1T, dse2C, dse2T, dse3C, dse3T, dse4C, dse4T, dse5C, dse5T)
dataplotDEMO <- data.frame(x3 = c('Inclusive', 'Inclusive', 'Best', 'Best', 'FARC goals', 'FARC goals', 'Voice', 'Voice', 'Efficient', 'Efficient'),
means3, se3,
Treatment = c('Control', 'Treatment', 'Control', 'Treatment', 'Control', 'Treatment', 'Control', 'Treatment', 'Control', 'Treatment'))
democracy <- ggplot(dataplotDEMO, aes(x=x3, y=means3, fill=Treatment)) +
geom_bar(stat="identity",
position=position_dodge()) +
geom_errorbar(aes(ymin=means3-se3, ymax=means3+se3), width=.2,
position=position_dodge(.9)) +
theme(text = element_text(size = 15)) +
scale_x_discrete(name ="Democracy")+
scale_y_continuous(name = "Mean agreement", limits = c(0, 10))+
theme(panel.background = element_blank())+
theme_bw()
ggsave("fA5_b.png",plot = democracy)
a1T <- mean(farcT$plan_vote2019, na.rm = T)
a1C <- mean(farcC$plan_vote2019, na.rm = T)
ase1T <- std.error(farcT$plan_vote2019, na.rm = T)
ase1C <- std.error(farcC$plan_vote2019, na.rm = T)
a2T <- mean(farcT$support_farc_candidate, na.rm = T)
a2C <- mean(farcC$support_farc_candidate, na.rm = T)
ase2T <- std.error(farcT$support_farc_candidate, na.rm = T)
ase2C <- std.error(farcC$support_farc_candidate, na.rm = T)
a3T <- mean(farcT$plan_campaigning, na.rm = T)
a3C <- mean(farcC$plan_campaigning, na.rm = T)
ase3T <- std.error(farcT$plan_campaigning, na.rm = T)
ase3C <- std.error(farcC$plan_campaigning, na.rm = T)
means2 <- c(a1C, a1T, a2C, a2T, a3C, a3T)
se2 <- c(ase1C, ase1T, ase2C, ase2T, ase3C, ase3T)
dataplota <- data.frame(x2 = c('Vote', 'Vote', 'Support Candidate', 'Support Candidate', 'Campaign', 'Campaign'),
means2, se2,
Treatment = c('Control', 'Treatment', 'Control', 'Treatment', 'Control', 'Treatment'))
participation <- ggplot(dataplota, aes(x=x2, y=means2, fill=Treatment)) +
geom_bar(stat="identity",
position=position_dodge()) +
geom_errorbar(aes(ymin=means2-se2, ymax=means2+se2), width=.2,
position=position_dodge(.9)) +
theme(text = element_text(size = 15)) +
scale_x_discrete(name ="Future political participation") +
scale_y_continuous(name = "Mean participation (N/Y)", limits = c(0, 1))+
theme(panel.background = element_blank())+
theme_bw()
ggsave("fA5_c.png",plot = participation)
e7T <- mean(farcT$moderation_platform, na.rm = T)
e7C <- mean(farcC$moderation_platform, na.rm = T)
ese7T <- std.error(farcT$moderation_platform, na.rm = T)
ese7C <- std.error(farcC$moderation_platform, na.rm = T)
e8T <- mean(farcT$moderation_alliance, na.rm = T)
e8C <- mean(farcC$moderation_alliance, na.rm = T)
ese8T <- std.error(farcT$moderation_alliance, na.rm = T)
ese8C <- std.error(farcC$moderation_alliance, na.rm = T)
means4 <- c(e7C, e7T, e8C, e8T)
se4 <- c(ese7C, ese7T, ese8C, ese8T)
dataplotPRAG <- data.frame(x4 = c( 'Platform', 'Platform', 'Alliances', 'Alliances'),
means4, se4,
Treatment = c('Control', 'Treatment', 'Control', 'Treatment'))
moderation <- ggplot(dataplotPRAG, aes(x=x4, y=means4, fill=Treatment)) +
geom_bar(stat="identity",
position=position_dodge()) +
geom_errorbar(aes(ymin=means4-se4, ymax=means4+se4), width=.2,
position=position_dodge(.9)) +
theme(text = element_text(size = 15)) +
scale_x_discrete(name ="Support for party moderation")+
scale_y_continuous(name = "Mean agreement", limits = c(0, 10))+
theme(panel.background = element_blank())+
theme_bw()
ggsave("fA5_d.png",plot = moderation)
<- mean(farcT$ideology_farc, na.rm = T)
ggsave("fA6.png",plot = ideology)
ideology <- ggplot(dataplotIDEO, aes(x=x5, y=means5, fill=Treatment)) +
geom_bar(stat="identity",
position=position_dodge()) +
geom_errorbar(aes(ymin=means5-se5, ymax=means5+se5), width=.2,
position=position_dodge(.9)) +
theme(text = element_text(size = 15)) +
scale_x_discrete(name ="Ideology")+
scale_y_continuous(name = "Mean ideology (R - L)", limits = c(0, 10))+
theme(panel.background = element_blank())+
theme_bw()
f4T <- mean(farcT$ideology_farc, na.rm = T)
f4C <- mean(farcC$ideology_farc, na.rm = T)
fse4T <- std.error(farcT$ideology_farc, na.rm = T)
fse4C <- std.error(farcC$ideology_farc, na.rm = T)
f5T <- mean(farcT$ideology_idealfarc, na.rm = T)
f5C <- mean(farcC$ideology_idealfarc, na.rm = T)
fse5T <- std.error(farcT$ideology_idealfarc, na.rm = T)
fse5C <- std.error(farcC$ideology_idealfarc, na.rm = T)
f6T <- mean(farcT$ideology_farcelections, na.rm = T)
f6C <- mean(farcC$ideology_farcelections, na.rm = T)
fse6T <- std.error(farcT$ideology_farcelections, na.rm = T)
fse6C <- std.error(farcC$ideology_farcelections, na.rm = T)
f7T <- mean(farcT$ideology_personal, na.rm = T)
f7C <- mean(farcC$ideology_personal, na.rm = T)
fse7T <- std.error(farcT$ideology_personal, na.rm = T)
fse7C <- std.error(farcC$ideology_personal, na.rm = T)
means5 <- c(f4C, f4T, f5C, f5T, f6C, f6T, f7C, f7T)
se5 <- c(fse4C, fse4T, fse5C, fse5T, fse6C, fse6T, fse7C, fse7T)
dataplotIDEO <- data.frame(x5 = c('FARC', 'FARC', 'Ideal FARC', 'Ideal FARC', 'Election FARC', 'Election FARC', 'Personal', 'Personal'),
means5, se5,
Treatment = c('Control', 'Treatment', 'Control', 'Treatment', 'Control', 'Treatment', 'Control', 'Treatment'))
ideology <- ggplot(dataplotIDEO, aes(x=x5, y=means5, fill=Treatment)) +
geom_bar(stat="identity",
position=position_dodge()) +
geom_errorbar(aes(ymin=means5-se5, ymax=means5+se5), width=.2,
position=position_dodge(.9)) +
theme(text = element_text(size = 15)) +
scale_x_discrete(name ="Ideology")+
scale_y_continuous(name = "Mean ideology (R - L)", limits = c(0, 10))+
theme(panel.background = element_blank())+
theme_bw()
ggsave("fA6.png",plot = ideology)
library(multilevel)
library(mediation)
set.seed(2020)
imputed$treated <- as.factor(imputed$treatment)
subfarc <- imputed %>% dplyr::select(trust_score, treatment,moderation_score, treated)
subfarc <- na.omit(subfarc)
fitM <- lm(trust_score ~ treated, data = subfarc)
fitY <- lm(moderation_score ~ treated + trust_score, data = subfarc)
fitMeda <- mediation::mediate(fitM, fitY, treat="treated", mediator="trust_score",boot = TRUE, sims = 500)
#summary(fitMed)
#summary(fitMed)
fA8 <- plot(fitMeda, main="Trust in inst. as a mediator of effect on moderation effect")
fa8
fA8
fA8
fA8a <- plot(fitMeda, main="Trust in inst. as a mediator of effect on moderation effect")
subfarc <- imputed %>% dplyr::select(democracy_score, treatment,moderation_score, treated)
subfarc <- na.omit(subfarc)
fitM <- lm(democracy_score ~ treated, data = subfarc)
fitY <- lm(democracy_score ~ treated + democracy_score, data = subfarc)
fitMedb <- mediation::mediate(fitM, fitY, treat="treated", mediator="democracy_score",boot = TRUE, sims = 500)
#summary(fitMed)
fA8b <- plot(fitMedb, main="Trust in democracy as a mediator of moderation effect")
ggsave("fA8a.png",plot = ideology)
ggsave("fA8a.png",plot = fA8a)
ggsave("fA8a.png",plot = fA8a)
#summary(fitMed)
fA8a <- plot(fitMeda, main="Trust in inst. as a mediator of effect on moderation effect")
ggsave("fA8a.png",plot = fA8a)
#summary(fitMed)
fA8b <- plot(fitMedb, main="Trust in democracy as a mediator of moderation effect")
#### Figure A 8: Effect size by sites ####
imputed <- merge(imputed, dplyr::select(farc, ID, front, position), by = "ID")
#Creating front level data to create mesaure of fractionalization
#creating variables that capture unit fracitonalization and workshop duration
fronts <- imputed %>% dplyr::select(front,municipio)
fronts$front <- trimws(fronts$front)
fronts <- fronts %>% filter(fronts$front != "NA")
#wsnobs is the number of fronts that are within each municipality
fronts <-  merge(fronts, fronts %>% group_by(municipio) %>% summarise(wsnobs = length(front)))
#wnobs is the number of individuals that are within each municipality
fronts <- merge(fronts, imputed %>% group_by(municipio) %>% summarise(wnobs = length(municipio)))
#snobs is the number of individuals that are within each municipality
fronts <- merge(fronts, fronts  %>% group_by(front, municipio) %>% summarise(snobs = length(front)))
fronts <- unique(fronts)
#s = for each unit within each workshop site, 1 - fractionalization measure
fronts$suw_2 <- (fronts$snobs / fronts$wnobs)^2
#merging data
fronts <- merge(fronts, fronts %>% dplyr::group_by(municipio) %>% dplyr::summarise(uf = 1 - sum(suw_2)))
imputed <- merge(imputed, unique(dplyr::select(fronts, municipio, uf)))
f <- unique(dplyr::select(fronts,municipio,uf))
colnames(f)[1] <- "Location"
#Estimating effect sizes by site
imputed$coyaima <- ifelse(imputed$municipio == "Coyaima", 1,0)
#N = 29
Coyaima <- imputed %>% dplyr::filter(imputed$municipio == "Coyaima")
c1 <- robust.se(lm(trust_score ~ assignment, weight = Coyaima$weight, data = Coyaima))
c1 <- coeftest(lm(trust_score ~ assignment, weight = Coyaima$weight, data = Coyaima),vcov = vcovHC, type = "HC0")
c1 <- coeftest(lm(trust_score ~ assignment, weight = Coyaima$weight, data = Coyaima),vcov = vcovHC, type = "HC0")
c2 <- coeftest(lm(democracy_score ~ assignment, weight = weight, data = Coyaima),vcov = vcovHC, type = "HC0")
c3 <- coeftest(lm(moderation_platform ~ assignment, weight = weight, data = Coyaima),vcov = vcovHC, type = "HC0")
imputed$coyaima <- ifelse(imputed$municipio == "Coyaima", 1,0)
#N = 29
Coyaima <- imputed %>% dplyr::filter(imputed$municipio == "Coyaima")
c1 <- coeftest(lm(trust_score ~ assignment, weight = Coyaima$weight, data = Coyaima),vcov = vcovHC, type = "HC0")
c2 <- coeftest(lm(democracy_score ~ assignment, weight = weight, data = Coyaima),vcov = vcovHC, type = "HC0")
c3 <- coeftest(lm(moderation_platform ~ assignment, weight = weight, data = Coyaima),vcov = vcovHC, type = "HC0")
imputed$planadas <- ifelse(imputed$municipio == "Planadas", 1,0)
#### Figure A 8: Effect size by sites ####
imputed <- merge(imputed, dplyr::select(farc, ID, front, position), by = "ID")
#Creating front level data to create mesaure of fractionalization
#creating variables that capture unit fracitonalization and workshop duration
fronts <- imputed %>% dplyr::select(front,municipio)
#### Figure A 8: Effect size by sites ####
imputed <- merge(imputed, dplyr::select(farc, ID, front, position), by = "ID")
#Creating front level data to create mesaure of fractionalization
#creating variables that capture unit fracitonalization and workshop duration
fronts <- imputed %>% dplyr::select(front,municipio)
fronts$front <- trimws(fronts$front)
fronts <- fronts %>% filter(fronts$front != "NA")
rm(fronts)
imputed <- merge(imputed, dplyr::select(farc, ID, front, position), by = "ID")
#Creating front level data to create mesaure of fractionalization
#creating variables that capture unit fracitonalization and workshop duration
fronts <- imputed %>% select(front,municipio)
imputed <- merge(imputed, dplyr::select(farc, ID, front, position), by = "ID")
#Creating front level data to create mesaure of fractionalization
#creating variables that capture unit fracitonalization and workshop duration
fronts <- imputed %>% dplyr::select(front,municipio)
fronts$front <- trimws(fronts$front)
fronts <- fronts %>% filter(fronts$front != "NA")
#### Figure A 8: Effect size by sites ####
imputed <- merge(imputed, dplyr::select(farc, ID, front, position), by = "ID")
imputed
names(imputed)
rm(list = ls())
library(readstata13)
library(plyr)
library(plotrix)
library(foreign)
library(stargazer)
library(ggplot2)
library(stm)
library(dplyr)
library(zoo)
library(car)
library(plyr)
library(knitr)
library(qwraps2)
library(knitr)
library(xtable)
library(qwraps2)
library(tibble)
library(gdata)
library(tidyr)
library(data.table)
library(stringr)
library(reshape2)
library(ggrepel)
library(dfadjust)
library(lmtest)
library(summarytools)
library(kableExtra)
library(experiment)
library(AER)
library(sandwich)
#library(ivpack)
library(psych)
library(remotes)
library(stats)
library(ggpubr)
setwd("~/Dropbox/Participacion Politica FARC/Data_workshops/Replication/Dataverse files")
load("data_notimputed.RData")
load("data_imputed.RData")
#### Figure A 8: Effect size by sites ####
imputed <- merge(imputed, dplyr::select(farc, ID, front, position), by = "ID")
imputed$front
sink()
imputed$front
